Upgrade ChartJs.Blazor to .NET 9 and support Blazor auto render#1
Upgrade ChartJs.Blazor to .NET 9 and support Blazor auto render#1TaylorWatson wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| await InvokeAsync(() => | ||
| { | ||
| _renderQueued = false; | ||
| StateHasChanged(); | ||
| }); |
There was a problem hiding this comment.
Stop re-render loop when JS interop unavailable
When JsRuntime.SetupChart throws during prerendering or a disconnected circuit, TryInitializeChartAsync enqueues another render via QueueRenderAsync. The lambda clears _renderQueued before calling StateHasChanged, so every failed attempt immediately schedules the next render with no delay, and OnAfterRenderAsync hits the same failure again. In Blazor auto render this results in an unbounded render loop while JavaScript interop is unavailable, keeping the prerendered request alive and consuming CPU until the page becomes interactive (or indefinitely if it never does). The component should avoid calling StateHasChanged in this situation or throttle retries, because the framework will automatically re-render once interactivity is ready.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68e704c7ee9083328c45b92f2201192e